using System;

namespace AgileCode.Practice.Step02
{
    public class Demo
    {
        public static void Run()
        {
            Copier.ptFlag = true;
            Copier.Copy();
        }
    }

    public static class Copier
    {
        // Write a program that copies characters from the keyboard to the printer.
        // Should now also be able to read from the paper tape reader.
        //    Cannot change the interface

        public static bool ptFlag;

        public static void Copy()
        {
            char c;
            while (Char.ToLower(c = (ptFlag ? PaperTape.Read() : Keyboard.Read())) != 'x')
                Printer.Write(c);
        }
    }
}